package ${package.Controller};

<#------------ BEGIN 导包 ------------>
<#list table.controllerImportPackages as pkg>
import ${pkg};
</#list>

<#------------ END   导包 ------------>
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <#if table.comment??>${table.comment!} </#if>前端控制器
 *
 * @author ${author}
 * @since ${date}
 */
@AllArgsConstructor
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} {
</#if>

<#if controllerField>
    private final ${composeService} composeService;
</#if>
<#------------ BEGIN list ---------->
<#if controllerListMethod>
    @GetMapping("/list")
    public List<${vo}> list(${request} request) {
        return composeService.list(request);
    }

</#if>
<#------------ END list ---------->
<#------------ BEGIN page ---------->
<#if controllerPageMethod>
    @GetMapping("/page")
    public IPage<${vo}> page(${pageRequest} request) {
        return composeService.page(request);
    }

</#if>
<#------------ END   page ---------->
<#------------ BEGIN getVO ---------->
<#if controllerGetMethod>
    @GetMapping("/{id}")
    public ${vo} getById(@PathVariable(name = "id") Serializable id) {
        return composeService.getVoById(id);
    }

</#if>
<#------------ END   getVO ---------->
<#------------ BEGIN delete ---------->
<#if controllerDeleteMethod>
    @DeleteMapping("/{id}")
    public boolean deleteById(@PathVariable(name = "id") Serializable id) {
        return composeService.deleteById(id);
    }

</#if>
<#------------ END   delete ---------->
}
